from multiprocessing import Process,JoinableQueue as Queue

class kbs(object):
    def __init__(self):
        self.q=Queue()

    def put_row(self):
        for i in range(1,11):
            kw=f'第{i}次执行'
            self.q.put(kw)

    def get_row(self):
        while True:
            data=self.q.get()
            print(data)

    def run(self):
        t1=Process(target=self.put_row)
        t2=Process(target=self.get_row)
        t1.start()
        t2.daemon=True
        t2.start()
        t1.join()

if __name__=='__main__':
    kbc=kbs()
    kbc.run()
    print("主进程执行结束")